package com.example.TodayNews;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Intellij IDEA
 * Project: TodayNews
 * Author: magic_chen_
 * Email: 196607376@qq.com
 * Date: 2015/6/15
 */
public class ChannelInit {
    private static List<String> channel;
    //初始化主界面Activity 上部的条目
    public static List<String> init(){
        channel = new ArrayList<>();
        channel.add("推荐");
        channel.add("热点");
        channel.add("本地");
        channel.add("视频");
        channel.add("社会");
        channel.add("娱乐");
        channel.add("科技");
        return channel;
    }

    /**
     * 增加频道的方法
     * @param s 需要增加的频道名称
     * @return
     */
    public static List<String> incChannel(String s){
       List<String> ret = channel;
        if(!channel.contains(s)){
            ret.add(s);
        }
        return ret;
    }

    /**
     * 减少频道的方法
     * @param s 需要减少的频道名称
     * @return
     */
    public static List<String> decChannel(String s){
        List<String> ret = channel;
        if(ret.contains(s)){
            ret.remove(s);
        }
        return ret;
    }
}
